package com.alex.utils;

public enum Constant {

    CODE_ERROR(201, "操作失败"),
    /**
     * 操作成功
     */
    CODE_SUCCESS(200, "操作成功");

    private int Value;
    private String name;

    Constant(int value, String name) {
        this.Value = value;
        this.name = name;
    }

    public int getValue() {
        return Value;
    }

    public String getName() {
        return name;
    }

    public static Constant getByValue(Integer value) {
        for (Constant authResult : values()) {
            if (authResult.getValue() == value) {
                return authResult;
            }
        }
        return null;
    }
}
